package servlet;

import java.io.IOException;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.Map;

import javax.servlet.ServletException;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import bean.Online;
import deo.onlinedeo;
import deo.tongjideo;

public class TongjiServlet extends HttpServlet{
	public void doGet(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {  
        this.doPost(request, response);  
    }  
    public void doPost(HttpServletRequest request, HttpServletResponse response)  
            throws ServletException, IOException {
    	
    	tongjideo db = new tongjideo();  
        String sql = " select * from online where  equ_date='2017-05-09'"; 
        
        ArrayList<Online> list = null;
		try {
			list = db.getOnlineList(sql);
		} catch (SQLException e) {
			e.printStackTrace();
		}
	
        request.setAttribute("list", list);  
        request.getRequestDispatcher("tongji.jsp").forward(request, response);  
    }  
}
